﻿using Kw.Combinatorics;
using System;

namespace Kw.CombinatoricsExamples
{
    class PermutationExample03
    {
        static void Main ()
        {
            Permutation permuRow = new Permutation (6);

            permuRow.Rank = 9;
            Console.WriteLine (permuRow);

            for (int elementIndex = 0; elementIndex < permuRow.Width; ++elementIndex)
                Console.WriteLine (permuRow[elementIndex]);

            permuRow.Rank = -1;
            Console.WriteLine ("Maximum Rank = " + permuRow.Rank);
        }

        /* Output:

        { 0, 1, 3, 4, 5, 2 }
        0
        1
        3
        4
        5
        2
        Maximum Rank = 719

        */
    }
}
